// components/theme-container/theme-container.js
import { hexToRgba } from '@/utils/util'
Component({
    externalClasses: ['custom-class'],
    properties: {},
    data: {
        theme: ''
    },
    lifetimes: {
        attached: function () {
            this.updateColor()
        }
    },
    methods: {
        updateColor() {
            const primaryColor = wx.getStorageSync('primaryColor')
            const secondaryColor = hexToRgba(primaryColor, 0.17)
            this.setData({
                theme: `--primary-color:${primaryColor};--secondary-color:${secondaryColor}`
            })
        }
    }
})
